/*
 * These files are distributed under the terms of the GNU GPLv2, the GNU General
 * Public version 2. See LICENSE.txt
 */
package fileCommodore.plugin;

import java.util.*;

import fileCommodore.model.*;


/**
 * @author nado18@gmail.com, on Jul 26, 2007
 */
public class Selection
{
	private FileRowItem current;
	private FileRowItem selected;
	private Vector<FileRowItem> tagged = new Vector<FileRowItem>();
	private Vector<FileRowItem> untagged = new Vector<FileRowItem>();
	private Vector<FileRowItem> unselected = new Vector<FileRowItem>();
	
	public FileRowItem getCurrent()
	{
		return current;
	}
	
	public Vector<FileRowItem> getTagged()
	{
		return tagged;
	}
	
	public Vector<FileRowItem> getUntagged()
	{
		return untagged;
	}
	
	public FileRowItem getSelected()
	{
		return selected;
	}
	
	public Vector<FileRowItem> getUnselected()
	{
		return unselected;
	}
	
	public void setSelected( FileRowItem item )
	{
		selected = item;
		addTaggedUntagged( item );
	}
	
	public void addUnelected( FileRowItem item )
	{
		unselected.add( item );
		addTaggedUntagged( item );
	}
	
	private void addTaggedUntagged( FileRowItem item )
	{
		if (item.isTagged())
		{
			tagged.add( item );
		}
		else
		{
			untagged.add( item );
		}
	}
	
	public void setCurrent( FileRowItem item )
	{
		current = item;
	}
}
